<?php
$this->renderPartial('..//filterTranslate/_form');
?>
<?php

$total = Translates::getTotalData($paramsTrans['language'], 'tbl_content','id','type="post"');
$page = new CPagination($total);

$page->pageSize = 20;
$curr_page = $page->getCurrentPage();
$data = Translates::GetListTransNews($paramsTrans['language'],$page->getLimit(), $page->getOffset());
?>
<div class="grid-view">
<table class="items" rules="all">
<thead>
<tr>
<th width="60"><div id="sl-row" onclick="CoreJs.checkAll(this.id);" ><input type="checkbox" class="checkall" value="" /></div></th>
<th><?php echo Yii::t('app','ID')?></th>
<th align="left"><?php echo Yii::t('app','Content')?></th>
<th align="left"><?php echo Yii::t('app','Content').'&nbsp;('.$languages[$paramsTrans['language']].')'?></th>
<th width="100"><?php echo Yii::t('app','Translated')?></th>
<th><?php echo Yii::t('app','Published')?></th>
<th><?php echo Yii::t('app','ID')?></th>
</tr>
</thead>
<tbody>
<?php
foreach ($data as $key => $value):
?>
<tr>
<td align="center"><input value="<?php echo $value['tid']; ?>" type="checkbox" name="rad_ID[]" id="rad_ID"></td>
<td><?php echo $value['id']?></td>
<td><?php echo $value['title']?>
</td>
<td>
<?php 
$Ctrans = @unserialize($value['trans_content']);
if(is_array($Ctrans) && $Ctrans["title"]!='')
	echo $Ctrans["title"];
?>
</td>
<td align="center"><?php if($value['published']!=''):?>
<img src="<?php echo Yii::app()->theme->baseUrl;?>/images/icons/checked.png" />
<a href="<?php echo Yii::app()->createUrl('admin_Translate/filterTranslate/UpdateTrans', array('id'=>$value['id']));?>"><?php echo Yii::t('app','Edit');?></a>
<?php else:?>
<a style="text-align: center;" href="<?php echo Yii::app()->createUrl('admin_Translate/filterTranslate/create', array('id'=>$value['id']))?>" class="button-s">Translate</a>
<?php endif;?>
</td>
<td align="center">
<?php if($value['published']==1):?>
<img src="<?php echo Yii::app()->theme->baseUrl;?>/images/icons/Published.png" />
<?php elseif($value['published']==0):?>
<img src="<?php echo Yii::app()->theme->baseUrl;?>/images/icons/Draft.png" />
<?php endif;?>
</td>
<td align="center"><?php echo $value['tid']?></td>
</tr>
<?php endforeach;?>
</tbody>
</table>
</div>
<div class="pagination">
<?php
	$this->widget('CLinkPager',
	array(
		'pages' => $page,
		'maxButtonCount'=>4
		));
	$this->widget('CListPager', array(
	    'pages'=>$page,
	));
		
?>

</div>